package com.oj.friend.controller.question;

import com.oj.common.core.controller.BaseController;
import com.oj.common.core.domain.R;
import com.oj.common.core.domain.TableDataInfo;
import com.oj.friend.domain.question.dto.QuestionQueryDTO;
import com.oj.friend.domain.question.vo.QuestionDetailVO;
import com.oj.friend.service.impl.QuestionServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.cglib.beans.BulkBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author bin
 * @Date 2025/6/9
 */
@RestController
@RequestMapping("/question")
public class QuestionController extends BaseController {

    @Resource
    private QuestionServiceImpl questionService;

    @GetMapping("/semiLogin/list")
    public TableDataInfo list(QuestionQueryDTO questionQueryDTO) {
        return questionService.list(questionQueryDTO);
    }

    @GetMapping("/detail")
    public R<QuestionDetailVO> detail(Long questionId) {
        return questionService.detail(questionId);
    }

    @GetMapping("/preQuestion")
    public R<String> preQuestion(Long questionId) {
        return R.ok(questionService.preQuestion(questionId));
    }

    @GetMapping("/nextQuestion")
    public R<String> nextQuestion(Long questionId) {
        return R.ok(questionService.nextQuestion(questionId));
    }
}
